package com.example.huixue.entity;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.time.LocalDateTime;

public class StudyGroup {
    private Integer groupId;
    
    @NotBlank(message = "小组名称不能为空")
    @Size(max = 100, message = "小组名称长度不能超过100字符")
    private String groupName;
    
    private String description;
    private Integer creatorId;
    private LocalDateTime createDate;
    
    // 关联属性
    private String creatorName;
    private Integer memberCount;
    
    public StudyGroup() {
        this.createDate = LocalDateTime.now();
    }
    
    public StudyGroup(String groupName, String description, Integer creatorId) {
        this.groupName = groupName;
        this.description = description;
        this.creatorId = creatorId;
        this.createDate = LocalDateTime.now();
    }
    
    public Integer getGroupId() {
        return groupId;
    }
    
    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }
    
    public String getGroupName() {
        return groupName;
    }
    
    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }
    
    public String getDescription() {
        return description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    public Integer getCreatorId() {
        return creatorId;
    }
    
    public void setCreatorId(Integer creatorId) {
        this.creatorId = creatorId;
    }
    
    public LocalDateTime getCreateDate() {
        return createDate;
    }
    
    public void setCreateDate(LocalDateTime createDate) {
        this.createDate = createDate;
    }
    
    public String getCreatorName() {
        return creatorName;
    }
    
    public void setCreatorName(String creatorName) {
        this.creatorName = creatorName;
    }
    
    public Integer getMemberCount() {
        return memberCount;
    }
    
    public void setMemberCount(Integer memberCount) {
        this.memberCount = memberCount;
    }
    
    @Override
    public String toString() {
        return "StudyGroup{" +
                "groupId=" + groupId +
                ", groupName='" + groupName + '\'' +
                ", description='" + description + '\'' +
                ", creatorId=" + creatorId +
                ", createDate=" + createDate +
                ", creatorName='" + creatorName + '\'' +
                ", memberCount=" + memberCount +
                '}';
    }
} 